import request from "@/utils/request"

export function getTestCompany() {
  return request({
    url: "/v1/cmdb/data/query?cmdb!modelNo=met_testing_institution&cmdb!modelId=44&cmdb!modelNo=met_testing_institution&isQuery=true&page=1&start=0&limit=1000",
    method: "get",
  })
}


// 上传修改
export function uploadEdit(data) {
  return request({
    url: "/v1/cmdb/data/update?cmdb!modelNo=met_testing_report&cmdb!modelId=37",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  })
}


export function deleteList(data) {
  return request({
    url: "/v1/cmdb/data/deleteList?cmdb!modelNo=met_testing_report",
    method: "post",
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data,
  })
}

// 获取检测
export function queryItems() {
  return request({
    url: `/v1/cmdb/data/query?cmdb!modelNo=met_lp_inspect_item&cmdb!modelId=22&cmdb!modelNo=met_lp_inspect_item&page=1&start=0&limit=100`,
    method: "get",
  })
}




export function getReportList(params) {
  return request({
    url: "/v1/plugins/met/testingReport/query?isQuery=true",
    method: "get",
    params,
  })
}


// 上传增加
export function uploadAdd(data) {
  return request({
    url: "/v1/plugins/met/testingReport/add",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  })
}

export function findByIdDetail(report_id) {
  return request({
    url: `/v1/plugins/met/testingReport/findById?_dc=1655787357757&testingReportId=${report_id}`,
    method: "get",
  })
}